$(function(){
	var $mrAdd = $('.mr-add');
	var $addOnly = $('.mr-add-only');
	var $hoverImg = $('.resume-hover-img');
	var $mrOptions = $('.mr-options');
	var $mrOptionsLi = $('.mr-options ul li');
	var $window = $(window);
	var $moduleEdit = $('.module-edit');
	var $choose = $('.choose');
	
	// 鼠标经过头像框，显示照相机
	$('#input-file').hover(function(){
		$('.resume-hover-img').css('display','block');
	},function(){
		$('.resume-hover-img').css('display','none');
	})
	
	// 点击编辑
	$moduleEdit.click(function(){
		$(this).parents('.items').next().css('display','block');
	})
	
	// 侧边栏点击变色
	$mrOptionsLi.click(function(){
		$mrOptionsLi.removeClass('active');
		$(this).addClass('active');
		$mrOptionsLi.children('i').removeClass('active');
		$(this).children('i').addClass('active');
	})
	
	
	// 侧边栏滑动到相应位置变色
	$window.scroll(function(){
		// 侧边栏滑动一定距离，位置固定
		var $scrollTop = $(window).scrollTop();
		if($scrollTop >= 129){
			$mrOptions.css({'position':'fixed','top':'0'});
		}else{
			$mrOptions.css('position','static');
		}
		/*var $position = $(document).scrollTop();
		var $position1 = $('#wishJob').offset().top;
		console.info($position1 - $position);*/
		var $baseInfo = $('#baseInfo').offset().top;
		var $wishJob = $('#wishJob').offset().top;
		var $workExperience = $('#workExperience').offset().top;
		var $itemExperience = $('#itemExperience').offset().top;
		var $educationExperience = $('#educationExperience').offset().top;
		var $selfAssessment = $('#selfAssessment').offset().top;
		// 点击滑动到指定位置
		$('.to-base').click(function(){
			$('body:not(:animated)').animate({scrollTop: $baseInfo},300);
		});
		$('.to-wish').click(function(){
			$('body:not(:animated)').animate({scrollTop: $('#wishJob').offset().top},300);
		});
		$('.to-work').click(function(){
			$('body:not(:animated)').animate({scrollTop: $('#workExperience').offset().top},300);
		});
		$('.to-item').click(function(){
			$('body:not(:animated)').animate({scrollTop: $('#itemExperience').offset().top},300);
		});
		$('.to-education').click(function(){
			$('body:not(:animated)').animate({scrollTop: $('#educationExperience').offset().top},300);
		});
		$('.to-self').click(function(){
			$('body:not(:animated)').animate({scrollTop: $('#selfAssessment').offset().top},300);
		});
		// 滚动到指定位置变亮
		$('.mr-options ul li').removeClass('active');
		if($scrollTop <= $wishJob){
			$('.to-base').addClass('active');
		}
		if($scrollTop > $wishJob && $scrollTop <= $workExperience){
			$('.to-wish').addClass('active');
		}
		if($scrollTop > $workExperience && $scrollTop <= $itemExperience){
			$('.to-work').addClass('active');
		}
		if($scrollTop > $itemExperience && $scrollTop <= $educationExperience){
			$('.to-item').addClass('active');
		}
		if($scrollTop > $educationExperience && $scrollTop <= $selfAssessment){
			$('.to-education').addClass('active');
		}
		if($scrollTop > $selfAssessment){
			$('.to-self').addClass('active');
		}
	});
	
	// 点击添加到choose,同时收上去
	var $detailItemUl = $('.detail-item ul');
	var $detailItemLi = $('.detail-item ul li');
	var $detailItemChoose = $('.detail-item .choose');
	//点击li，收上去
	$(document).on('click','.detail-item ul li',function(){
		event.stopPropagation();
		$(this).parent().prev().children('input').val($(this).html());
		$(this).parent().slideUp();
		$(this).addClass('li-active');
	});
	
	
	// 点击收上去、滑下来
	$(document).on('click','.detail-item .choose',function(){
		event.stopPropagation();
		$(this).next('ul').slideToggle();
	});
	
	// 性别选择
	$(document).on('click','.mr-sex',function(){
		$('.mr-sex span').removeClass('active');
		$(this).children('span').addClass('active');
	})
	
	/**
	 * 基本信息
	 */
	
	var $baseInfoMessage = $('#baseInfoMessage');
	var $baseInfoAdd = $('#baseInfoAdd');
	var $baseInfoEdit = $('#baseInfoEdit');
	var $baseInfoSave = $('.base-info-button-save');
	var $baseInfoCancel = $('.base-info-button-cancel');
	var $baseForm = $('#baseForm');
	var $baseInfoArticle = $('#baseInfoArticle');
	
	$baseInfoAdd.click(function() {
		var thisDivHeader = $(this).parent().parent();
		if(thisDivHeader.next().is(':visible')){
			alert('未操作完，禁止重复操作！');
		}else{
			thisDivHeader.after($baseInfoMessage.html());
			thisDivHeader.after($baseForm.html());
			thisDivHeader.next().show();
			thisDivHeader.next().next().hide();
		}
	});
	var a = 1;
	$(document).on('click','.base-info-button-save',function(){
		var thisForm = $(this).parents('.mr-form');
		var thisFormNextDiv = $(this).parents('.mr-form').next();
		
		var $mrName = thisFormNextDiv.find('.mr-name');
		var $mrNameInput = thisForm.find('.base-info-name-input');
		var $mrIntroduce = thisFormNextDiv.find('.base-info-introduce');
		var $mrIntroduceInput = thisForm.find('.base-info-introduce-input');
		var $mrSex = thisFormNextDiv.find('.user-sex');
		var $mrSexInput = thisForm.find('.mr-sex .active');
		var $mrBirthday = thisFormNextDiv.find('.user-birthday');
		var $mrBirthdayInput = thisForm.find('.base-info-birthday-input');
		var $mrEducation = thisFormNextDiv.find('.base-info-education');
		var $mrEducationInput = thisForm.find('.base-info-education-input');
		var $mrWorkExperience = thisFormNextDiv.find('.base-info-woek-experience');
		var $mrWorkExperienceInput = thisForm.find('.base-info-work-experience-input');
		var $mrCity = thisFormNextDiv.find('.base-info-city');
		var $mrCityInput = thisForm.find('.base-info-city-input');
		var $mrPhone = thisFormNextDiv.find('.base-info-phone');
		var $mrPhoneInput = thisForm.find('.base-info-phone-input');
		var $mrEmail = thisFormNextDiv.find('.base-info-email');
		var $mrEmailInput = thisForm.find('.base-info-email-input');
		
		var mrNameInputVal = $.trim(thisForm.find('.base-info-name-input').val());
		var mrIntroduceInputVal = $.trim(thisForm.find('.base-info-introduce-input').val());
		var mrPhoneInputVal = $.trim(thisForm.find('.base-info-phone-input').val());
		var mrEmailInputVal = $.trim(thisForm.find('.base-info-email-input').val());
		
		var wishWorkInputVal = $.trim($wishWorkInput.val());
		
		if (mrNameInputVal != '' && $.trim($mrSexInput.html()) != '' && $.trim($mrBirthdayInput.val()) != '' && $.trim($mrEducationInput.val()) != '' && $.trim($mrWorkExperienceInput.val())  != '' && $.trim($mrCityInput.val()) != '' && mrPhoneInputVal != '' && mrEmailInputVal != '') {
			$mrName.html(mrNameInputVal);
			$mrIntroduce.html(mrIntroduceInputVal);
			$mrSex.html($mrSexInput.html());
			$mrBirthday.html($mrBirthdayInput.val());
			$mrEducation.html($mrEducationInput.val());
			$mrWorkExperience.html($mrWorkExperienceInput.val());
			$mrCity.html($mrCityInput.val());
			$mrPhone.html(mrPhoneInputVal);
			$mrEmail.html(mrEmailInputVal);
			
			$(this).parents('.mr-form').hide();
			$(this).parents('.mr-form').next().show();
			$baseInfoAdd.hide();
			$baseInfoEdit.show();
			a = 1;
		} else {
			alert('输入项不能为空！');
		}
	});
	$baseInfoEdit.click(function() {
		$(this).parents('.mr-module-head').next().next().hide();
		$(this).parents('.mr-module-head').next().show();
		
		var thisForm = $(this).parents('.mr-form');
		var thisFormNextDiv = $(this).parents('.mr-form').next();
		
		var $mrName = thisFormNextDiv.find('.mr-name');
		var $mrNameInput = thisForm.find('.base-info-name-input');
		var $mrIntroduce = thisFormNextDiv.find('.base-info-introduce');
		var $mrIntroduceInput = thisForm.find('.base-info-introduce-input');
		var $mrSex = thisFormNextDiv.find('.user-sex');
		var $mrSexInput = thisForm.find('.mr-sex .active');
		var $mrBirthday = thisFormNextDiv.find('.user-birthday');
		var $mrBirthdayInput = thisForm.find('.base-info-birthday-input');
		var $mrEducation = thisFormNextDiv.find('.base-info-education');
		var $mrEducationInput = thisForm.find('.base-info-education-input');
		var $mrWorkExperience = thisFormNextDiv.find('.base-info-woek-experience');
		var $mrWorkExperienceInput = thisForm.find('.base-info-work-experience-input');
		var $mrCity = thisFormNextDiv.find('.base-info-city');
		var $mrCityInput = thisForm.find('.base-info-city-input');
		var $mrPhone = thisFormNextDiv.find('.base-info-phone');
		var $mrPhoneInput = thisForm.find('.base-info-phone-input');
		var $mrEmail = thisFormNextDiv.find('.base-info-email');
		var $mrEmailInput = thisForm.find('.base-info-email-input');
		
		$mrNameInput.val($mrName.html());
		$mrIntroduceInput.val($mrIntroduce.html());
		$mrSexInput.val($mrSex.html());
		$mrBirthdayInput.val($mrBirthday.html());
		$mrEducationInput.val($mrEducation.html());
		$mrWorkExperienceInput.val($mrWorkExperience.html());
		$mrCityInput.val($mrCity.html());
		$mrPhoneInput.val($mrPhone.html());
		$mrEmailInput.val($mrEmail.html());
		a = 2;
	});
	$(document).on('click','.base-info-button-cancel',function(){
		if(a == 1) {
			$(this).parents('.mr-form').remove();
			$(this).parents('.mr-form').next().remove();
		}
		if(a == 2){
			$(this).parents('.mr-form').hide();
			$(this).parents('.mr-form').next().show();
		}
	});
	
	/**
	 * 期望工作
	 */
	var $wishWorkAdd = $('#wishWorkAdd');
	var $wishWorkEdit = $('#wishWorkEdit');
	var $wishWorkForm = $('#wishWorkForm');
	var $wishWorkSave = $('#wishWorkSave');
	var $wishWorkCancel = $('#wishWorkCancel');
	var $wishWork = $('#wishWork');
	var $wishWorkInput = $('#wishWorkInput');
	$wishWorkAdd.click(function() {
		$wishWorkForm.show();
	});
	$wishWorkEdit.click(function() {
		$wishWorkForm.show();
		$wishWork.hide();
		$wishWorkInput.val($wishWork.html());
	});
	$wishWorkSave.click(function() {
		var wishWorkInputVal = $.trim($wishWorkInput.val());
		if (wishWorkInputVal != '') {
			$wishWork.html(wishWorkInputVal);
			$wishWork.show();
			$wishWorkForm.hide();
			$wishWorkAdd.hide();
			$wishWorkEdit.show();
		} else {
			alert('输入的期望职位不能为空！');
		}
	});
	$wishWorkCancel.click(function() {
		$wishWorkForm.hide();
		$wishWorkInput.val('');
		$wishWork.show();
	});
	
	/*
	 * 工作经历
	 */
	/*添加,是添加两个：一个是form，一个是对应的空白的div*/
	var $workExperienceAdd = $('#workExperienceAdd');
	var $workMessageForm = $('#workMessageForm');
	var $workExperienceEmpty = $('#workExperienceEmpty');
	$workExperienceAdd.click(function(){
		if($(this).parent().next().next().is(':visible')){
			alert('未结束操作，禁止重复添加！');
		}else{
			$(this).parent().after($workMessageForm.html());
			$(this).parent().after($workExperienceEmpty.html());
			$(this).parent().next().next().show();
		}
		$(this).parent().next().hide();
	});
	// 保存按钮
	$(document).on('click','.work-experience-add-button-save',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		
		var companyInputVal = $.trim(newForm.find('.company-input').val());
		var positionInputVal = $.trim(newForm.find('.position-input').val());
		var contentInputVal = $.trim(newForm.find('.content-input').val());
		var startTime = newForm.find('.start-time');
		var endTime = newForm.find('.end-time');
		
		if(companyInputVal != '' && positionInputVal != '' && $.trim(startTime.val()) != '' && $.trim(endTime.val()) != '' && contentInputVal != ''){
			newDiv.find('.mr-company').html(companyInputVal);
			newDiv.find('.mr-position').html(positionInputVal);
			newDiv.find('.mr-start-time').html(startTime.val());
			newDiv.find('.mr-end-time').html(endTime.val());
			newDiv.find('.mr-content').html(contentInputVal);
			newForm.hide();
			newDiv.show();
		}else{
			alert('输入项不能为空！');
		}
		
	});
	// 取消按钮
	$(document).on('click','.work-experience-add-button-cancel',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newForm.remove();
		newDiv.remove();
	});
	/*点击编辑，将新的编辑界面添加到相应的div后面，重新赋值*/
	var $workExperenceForm = $('#workExperenceForm');
	$(document).on('click','.work-experience-add-eidt',function(){
		if($(this).parent().parent().parent().next().is(':visible')){
			alert('未结束操作，禁止重复添加！');
		}else{
			$(this).parent().parent().parent().after($workExperenceForm.html());
			var thisDivNextForm = $(this).parent().parent().parent().next();
			var thisDiv = $(this).parents('.user-message');
			thisDivNextForm.show();
			thisDivNextForm.find('.work-experience-edit-company-name-input').val(thisDiv.find('.mr-company').html());
			thisDivNextForm.find('.work-experience-edit-position-name-input').val(thisDiv.find('.mr-position').html());
			thisDivNextForm.find('.work-experience-edit-start-time-input').val(thisDiv.find('.mr-start-time').html());
			thisDivNextForm.find('.work-experience-edit-end-time-input').val(thisDiv.find('.mr-end-time').html());
			thisDivNextForm.find('.work-experience-edit-work-content-input').val(thisDiv.find('.mr-content').html());
		}
		$(this).parent().parent().parent().hide();
	});
	// 保存按钮
	$(document).on('click','.work-experience-button-save',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newDiv.find('.mr-company').html(newForm.find('.work-experience-edit-company-name-input').val());
		newDiv.find('.mr-position').html(newForm.find('.work-experience-edit-position-name-input').val());
		newDiv.find('.mr-start-time').html(newForm.find('.work-experience-edit-start-time-input').val());
		newDiv.find('.mr-end-time').html(newForm.find('.work-experience-edit-end-time-input').val());
		newDiv.find('.mr-content').html(newForm.find('.work-experience-edit-work-content-input').val());
		newForm.hide();
		newDiv.show();
	});
	// 取消按钮
	$(document).on('click','.work-experience-button-cancel',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newForm.hide();
		newDiv.show();
	});
	// 删除本条
	$(document).on('click','.work-experience-button-del',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newForm.remove();
		newDiv.remove();
	})
	
	
	/*
	 * 项目经验
	 */
	/*添加,是添加两个：一个是form，一个是对应的空白的div*/
	var $itemExperenceAdd = $('#itemExperenceAdd');
	var $itemMessageForm = $('#itemMessageForm');
	var $itemMessageEmpty = $('#itemMessageEmpty');
	$itemExperenceAdd.click(function(){
		if($(this).parent().next().next().is(':visible')){
			alert('未结束操作，禁止重复添加！');
		}else{
			$(this).parent().after($itemMessageForm.html());
			$(this).parent().after($itemMessageEmpty.html());
			$(this).parent().next().next().show();
		}
		$(this).parent().next().hide();
	});
	// 保存按钮
	$(document).on('click','.item-experience-add-button-save',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		
		var itemExperienceNameInputVal = $.trim(newForm.find('.item-experience-name-input').val());
		var itemExperiencePositionInputVal = $.trim(newForm.find('.item-experience-position-input').val());
		var itemExperienceContentInputVal = $.trim(newForm.find('.item-experience-content-input').val());
		var itemExperienceStarTime = newForm.find('.item-experience-start-time');
		var itemExperienceEndTime = newForm.find('.item-experience-end-time');
		
		if(itemExperienceNameInputVal != '' && itemExperiencePositionInputVal != '' && itemExperienceContentInputVal != '' && $.trim(itemExperienceStarTime.val()) != '' && $.trim(itemExperienceEndTime.val()) != ''){
			newDiv.find('.item-name').html(itemExperienceNameInputVal);
			newDiv.find('.item-position').html(itemExperiencePositionInputVal);
			newDiv.find('.start-time').html(itemExperienceStarTime.val());
			newDiv.find('.end-time').html(itemExperienceEndTime.val());
			newDiv.find('.mr-content').html(itemExperienceContentInputVal);
			newForm.hide();
			newDiv.show();
		}else{
			alert('输入项不能为空！');
		}
		
	});
	// 取消按钮
	$(document).on('click','.item-experience-add-button-cancel',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newForm.remove();
		newDiv.remove();
	});
	/*点击编辑，将新的编辑界面添加到相应的div后面，重新赋值*/
	var $itemForm = $('#itemForm');
	$(document).on('click','.item-experience-add-eidt',function(){
		if($(this).parent().parent().parent().next().is(':visible')){
			alert('未结束操作，禁止重复操作！');
		}else{
			$(this).parent().parent().parent().after($itemForm.html());
			var thisDivNextForm = $(this).parent().parent().parent().next();
			var thisDiv = $(this).parents('.user-message');
			thisDivNextForm.show();
			thisDivNextForm.find('.item-experience-edit-name-input').val(thisDiv.find('.item-name').html());
			thisDivNextForm.find('.item-experience-edit-position-input').val(thisDiv.find('.item-position').html());
			thisDivNextForm.find('.item-experience-edit-start-time').val(thisDiv.find('.start-time').html());
			thisDivNextForm.find('.item-experience-edit-end-time').val(thisDiv.find('.end-time').html());
			thisDivNextForm.find('.item-experience-eidt-content-input').val(thisDiv.find('.mr-content').html());
		}
		$(this).parent().parent().parent().hide();
	});
	// 保存按钮
	$(document).on('click','.item-experience-button-save',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newDiv.find('.item-name').html(newForm.find('.item-experience-edit-name-input').val());
		newDiv.find('.item-position').html(newForm.find('.item-experience-edit-position-input').val());
		newDiv.find('.start-time').html(newForm.find('.item-experience-edit-start-time').val());
		newDiv.find('.end-time').html(newForm.find('.item-experience-edit-end-time').val());
		newDiv.find('.mr-content').html(newForm.find('.item-experience-eidt-content-input').val());
		newForm.hide();
		newDiv.show();
	});
	// 取消按钮
	$(document).on('click','.item-experience-button-cancel',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newForm.hide();
		newDiv.show();
	});
	// 删除本条
	$(document).on('click','.item-experience-button-del',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newForm.remove();
		newDiv.remove();
	});
	
	
	/*
	 * 教育经历
	 */
	/*添加,是添加两个：一个是form，一个是对应的空白的div*/
	var $educationExperienceAdd = $('#educationExperienceAdd');
	var $educationMessageForm = $('#educationMessageForm');
	var $educationMessageEmpty = $('#educationMessageEmpty');
	$educationExperienceAdd.click(function(){
		if($(this).parent().next().next().is(':visible')){
			alert('未结束操作，禁止重复添加！');
		}else{
			$(this).parent().after($educationMessageForm.html());
			$(this).parent().after($educationMessageEmpty.html());
			$(this).parent().next().next().show();
		}
		$(this).parent().next().hide();
	});
	// 保存按钮
	$(document).on('click','.education-experience-add-button-save',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		
		var educationExperienceNameInputVal = $.trim(newForm.find('.education-experience-name-input').val());
		var educationExperiencePositionInputVal = $.trim(newForm.find('.education-experience-position-input').val());
		var educationExperienceDiplomasInputVal = $.trim(newForm.find('.education-experience-diplomas-input').val());
		var educationExperienceEndTimeVal = $.trim(newForm.find('.education-experience-end-time').val());
		
		if(educationExperienceNameInputVal != '' && educationExperiencePositionInputVal != '' && educationExperienceDiplomasInputVal != '' && educationExperienceEndTimeVal != ''){
			newDiv.find('.school-name').html(educationExperienceNameInputVal);
			newDiv.find('.education-position').html(educationExperiencePositionInputVal);
			newDiv.find('.education-experience-diplomas').html(educationExperienceDiplomasInputVal);
			newDiv.find('.education-end-time').html(educationExperienceEndTimeVal);
			newForm.hide();
			newDiv.show();
		}else{
			alert('输入项不能为空！');
		}
	});
	// 取消按钮
	$(document).on('click','.education-experience-add-button-cancel',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newForm.remove();
		newDiv.remove();
	});
	/*点击编辑，将新的编辑界面添加到相应的div后面，重新赋值*/
	var $educationForm = $('#educationForm');
	$(document).on('click','.education-experience-add-eidt',function(){
		if($(this).parent().parent().next().is(':visible')){
			alert('未结束操作，禁止重复操作！');
		}else{
			$(this).parent().parent().after($educationForm.html());
			var thisDivNextForm = $(this).parent().parent().next();
			var thisDiv = $(this).parents('.user-message');
			thisDivNextForm.show();
			thisDivNextForm.find('.education-experience-edit-name-input').val(thisDiv.find('.school-name').html());
			thisDivNextForm.find('.education-experience-edit-diplomas-input').val(thisDiv.find('.education-position').html());
			thisDivNextForm.find('.education-edit-position-input').val(thisDiv.find('.education-experience-diplomas').html());
			thisDivNextForm.find('.education-edit-end-time-input').val(thisDiv.find('.education-end-time').html());
		}
		$(this).parent().parent().hide();
	});
	// 保存按钮
	$(document).on('click','.education-experience-button-save',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newDiv.find('.school-name').html(newForm.find('.education-experience-edit-name-input').val());
		newDiv.find('.education-position').html(newForm.find('.education-experience-edit-diplomas-input').val());
		newDiv.find('.education-experience-diplomas').html(newForm.find('.education-edit-position-input').val());
		newDiv.find('.education-end-time').html(newForm.find('.education-edit-end-time-input').val());
		newForm.hide();
		newDiv.show();
	});
	// 取消按钮
	$(document).on('click','.education-experience-button-cancel',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newForm.hide();
		newDiv.show();
	});
	// 删除本条
	$(document).on('click','.education-experience-button-del',function(){
		var newForm = $(this).parents('.mr-form');
		var newDiv = newForm.prev();
		newForm.remove();
		newDiv.remove();
	});
		
	
	/*
	 * 自我评价
	 */
	var $mrSelfAssessmentAdd = $('#mrSelfAssessmentAdd');
	var $mrSelfAssessmentEdit = $('#mrSelfAssessmentEdit');
	var $mrSelfAssessment = $('#mrSelfAssessment');
	var $mrSelfAssessmentInput = $('#mrSelfAssessmentInput');
	var $assessmentForm = $('#assessmentForm');
	var $selfAssessmentShow = $('#selfAssessmentShow');
	var $mrSelfAssessmentSave = $('#mrSelfAssessmentSave');
	var $mrSelfAssessmentCancel = $('#mrSelfAssessmentCancel');
	
	$mrSelfAssessmentAdd.click(function() {
		$assessmentForm.show();
	});
	$mrSelfAssessmentEdit.click(function() {
		$assessmentForm.show();
		$selfAssessmentShow.hide();
		$mrSelfAssessmentInput.val($mrSelfAssessment.html());
	});
	
	$mrSelfAssessmentSave.click(function() {
		var $mrSelfAssessmentInputVal = $.trim($mrSelfAssessmentInput.val());
		if ($mrSelfAssessmentInputVal != '') {
			$mrSelfAssessment.html($mrSelfAssessmentInputVal);
			$selfAssessmentShow.show();
			$assessmentForm.hide();
			$mrSelfAssessmentAdd.hide();
			$mrSelfAssessmentEdit.show();
		} else {
			alert('输入的自我评价不能为空！');
		}
	});
	$mrSelfAssessmentCancel.click(function() {
		$assessmentForm.hide();
		$selfAssessmentShow.show();
	});
});
